//
//  SocketEngineWebSocket.h
//  Socket.IO-Client
//
//  Created by alanwang.dev on 16/8/8.
//  Copyright © 2016年 com.alanwang.dev. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "SocketEngineSpec.h"
#import "WebSocket.h"

#pragma mark - SocketEngineWebSocketDelegate
@protocol SocketEngineWebSocketDelegate <NSObject,SocketEngineSpecProtocol,WebSocketDelegate>
/// Send message on WebSockets
/// Only call on emitQueue
- (void)sendWebSocketMessage:(NSString *)str type:(SocketEnginePacketType)type datas:(NSArray <NSData *> *)datas;

@end


#pragma mark - SocketEngineWebSocket
// WebSocket methods
@interface SocketEngineWebSocket : SocketEngineSpec<SocketEngineWebSocketDelegate>

- (void)probeWebSocket;

- (void)sendWebSocketMessage:(NSString *)str type:(SocketEnginePacketType)type datas:(NSArray <NSData *> *)datas;

- (void)websocketDidReceiveMessage:(WebSocket *)socket text:(NSString *)text;

- (void)websocketDidReceiveData:(WebSocket *)socket data:(NSData *)data;

@end
